package cn.tedu.basic;

import java.util.Random;
import java.util.Scanner;

public class Test5_While {
    public static void main(String[] args) {
        int random = new Random().nextInt(100);
        System.out.println(random);
        while (random > 60) {
            int input = new Scanner(System.in).nextInt();
            if (input > random) {
                System.out.println("大了");
            } else if (input < random) {
                System.out.println("小了");
            } else if (input == random) {
                System.out.println("猜中了!!");
                break;//结束程序，设置了死循环的出口!!!
            }
        }
    }
}
